home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / reform12.zip / REFORM12.DOC < prev    next >
Text File  |  1987-05-23  |  7KB  |  144 lines

  1.   15 apr 1986                                            Reformat - 1 -
  2.  
  3.  
  4.                 REFORMAT: an original JOS disk tool.
  5.                           Version 1.21TH
  6.  
  7.                    Use this program as follows:
  8.  
  9.       REFORMAT {d:}  where d: is the drive containing the disk to be
  10.  reorganized. If d: is omitted, the default drive is selected.
  11.  
  12.       REFORMAT ? will present a helpscreen.
  13.  
  14.       The performance of disk I/O becomes bad when when a disk has been
  15.  used for a long time,  because files will not be contiguous, and files
  16.  that are used  concurrently will  not be in adjacent parts of the disk.
  17.  Files on often  used disk ( floppy or fixed ) tend to become scattered
  18.  all over the disk. Not only files that are several times extended, but
  19.  after a while also  new  files  will not be contiguous,  when created.
  20.  Consider a disk  with a lot of files.  Erasing a number of small files
  21.  will  free clusters that are  randomly distributed  among the occupied
  22.  clusters,  so a new larger  file will be  broken  up in a lot of small
  23.  pieces. For files that are read sequentially this is only a small loss
  24.  of efficiency, but when reading or writing a  random acces file like a
  25.  database, performance is  very low.  Not only  head movements from one
  26.  from one cluster to another will have a bad effect on performance.
  27.  Since in DOS 2.xx not the  total  FAT is kept in  memory,  accessing a
  28.  widely scattered  file might cause extra head movement when DOS has to
  29.  read another part of the FAT.
  30.       A program reading or writing more than  one file at  random  will
  31.  suffer from bad I/O performance if  the files  are  not close together
  32.  on the disk. The subdirectory facility under DOS only  provides a kind
  33.  of 'administrative adjacency', not physical adjacency.
  34.       This all is important for fixed disks in the first place, but for
  35.  floppy  disks also,  because head  movements on floppy disk drives are
  36.  rather slow, as is the head settling time.
  37.  
  38.       To  solve  this  problem  I have  written the *REFORMAT* program.
  39.  REFORMAT  will look at all files on a disk, both in the root directory
  40.  and in all  subdirecties, to find out whether  they are contiguous. If
  41.  at least one  file (or subdirectory) is  found to be not  contiguous a
  42.  complete reorganization of the disk is done.
  43.  This reorganization consists of the following:
  44.  
  45.  1) Root directory and all subdirectories are cleaned of erased entries.
  46.     This  should  optimize   the  time   DOS  needs   to find an entry,
  47.     especially in  directories  that  contain  a  great deal  of erased
  48.     files. The order of entries in a (sub)directory is never changed.
  49.  
  50.  
  51.   15 apr 1986                                            Reformat - 2 -
  52.  
  53.  2) All files are made contiguous.
  54.  
  55.  3) Files and subdirectories are moved, as far as necessary:
  56.     Every (sub)directory is immediately followed  by  all the  files it
  57.     owns, followed by all the subdirectories it is parent of. Using the
  58.     last sentence  recursively, the  place of every file on the disk is
  59.     determined now.
  60.     Due to  the algorithm used, the  order in  which subdirectories are
  61.     written to disk is the  reversed of the  order in which they appear
  62.     in the parent directory. The order for the files is never changed.
  63.  
  64.  Placing all files in a subdirectory closely together on disk minimizes
  65.  head movements when accessing mulptiple files in a program: place them
  66.  in the same subdirectory, and after REFORMAT they are physically close
  67.  together on the disk.
  68.  
  69.  REFORMAT  presents a screen with  information  about  the disk and the
  70.  files. The number of dataclusters to be moved is also presented.  This
  71.  number will in some cases be greater than the number of used clusters.
  72.  This is not an error, but it is necessary to move unused clusters that
  73.  appear between the used clusters.
  74.  
  75.  * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
  76.  
  77.  NEVER,  NEVER run REFORMAT on a disk that contains protected software,
  78.  because it could ruin part of the protection scheme, or even the whole
  79.  disk. Some disk  optimizers leave  hidden files  on a disk unaffected.
  80.  REFORMAT affects *ALL* files, regardless of their attributes.  Leaving
  81.  hidden files  unaffected is not always  save with  regard to protected
  82.  software. Since there are a number of programs that easily change file
  83.  attributes, files  meant to be  hidden may have  been  made  unhidden.
  84.  (I have seen IBMBIO.COM and IBMDOS.COM on some disks with a normal DIR
  85.  command).  Therefore:  protected software should  *ALWAYS*  be removed
  86.  from a disk (UNINSTALL or something like that) before running REFORMAT.
  87.  In case you run REFORMAT  on a fixed disk, the program will prompt you
  88.  to confirm that no protected  software is on the disk, just before the
  89.  actual reformatting wil start.
  90.  
  91.                     * * * * * * * * * * * * * *
  92.  
  93.  Although much effort has  been spent to  create a reliable program, it
  94.  is strongly recommended that you make a backup of your disk before you
  95.  run REFORMAT. A crash during REFORMATting will render your disk either
  96.  partially or totally unusable.  In case of a  read or write error, the
  97.  program  prompts you  with the question  whether  to  Abort, Retry, or
  98.  Ignore the error. The Ignore  option is  available only after a change
  99.  to the  disk has been  made by the program.  Always try some  Retries,
  100.  
  101.   15 apr 1986                                            Reformat - 3 -
  102.  
  103.  before going to Ignore. The Ignore option is provided to  minimize the
  104.  loss of data: since  data are read and written one  cluster at a time,
  105.  an Ignore will cause only one cluster to be lost. (Depending  on disk-
  106.  type, 1 to 4 Kb).  An Abort will probably  always  cause a lot of data
  107.  to be lost. (They are still on the disk, however, so it is possible to
  108.  find them using a program like the NORTON utilities).
  109.  One of the  future  expansions of the  program will  be  an  automatic
  110.  recovery facility, by logging  changes  made  to the  disk on  another
  111.  drive.
  112.                     * * * * * * * * * * * * * *
  113.  
  114.      This program is donated to the  public domain.  No charge is asked
  115.  if you use it, but it may not be used in a commercial environment, nor
  116.  may you charge a fee for its use or for a copy of it. Commercial users
  117.  please contact me at the address below.
  118.  
  119.  Comments, bugs etc. should be send to
  120.  
  121.                      Jos Wennmacker
  122.                      Universitair Rekencentrum
  123.                      Geert Grooteplein Zuid 41
  124.                      NL 6525 GA Nijmegen
  125.                      The Netherlands.
  126.  
  127.                     * * * * * * * * * * * * * *
  128.  
  129.  To run the program if you did not download or copy a REFORMAT.COM file
  130.  proceed as follows:
  131.  1) Run TURBO-PASCAL
  132.     a) go to the Option screen,
  133.        select C (com file to be generated when compiling)
  134.        select I (mInimum free dynamic memory)
  135.                  enter 1000. This will ensure there is always
  136.                  enough room on the heap for about 1000 files.
  137.        [Toad Hall Note:  With approximately 200Kb of free RAM, this
  138.         code compiles perfectly with NO special ("I") options selected.]
  139.        Quit the options screen.
  140.     b) compile REFORMAT.PAS. REFORMAT.INC should be on the logged
  141.        drive; if it is not, change the line where it is included.
  142.  8) Quit TURBO.
  143.  9) You can now run REFORMAT.
  144.